package com.onlyxiahui.framework.action.dispatcher.registry;

import java.util.ArrayList;
import java.util.List;

import com.onlyxiahui.framework.action.dispatcher.extend.ActionBox;

/**
 * Date 2019-01-12 09:16:22<br>
 * Description
 * 
 * @author XiaHui<br>
 * @since 1.0.0
 */

public class ActionBoxRegistry {

	List<ActionBox> list = new ArrayList<>();

	public void add(ActionBox actionBox) {
		list.add(actionBox);
	}

	public Object getAction(Class<?> type) {
		Object o = null;
		for (ActionBox ab : list) {
			o = ab.getAction(type);
			if (null != o) {
				return o;
			}
		}
		return null;
	}
}
